
from celery import shared_task
import time

@shared_task
def add(x, y):
    time.sleep(5)
    return x + y


@shared_task
def mul(x, y):
    return x * y


@shared_task
def xsum(numbers):
    return sum(numbers)

# from apps.crm.models import CheckingIn
# from django.db.models import Max, Min
# @shared_task
# def checking_in_statistics():
#     result = CheckingIn.objects.filter(date__year=2017, date_month=10, date__day=1).values('user').annotate(
#         sign_time=Min('sign_time'), leave_time=Max('sign_time'))
#     # result = CheckingIn.objects.all().values('date','user').annotate(min=Min('sign_time'), max=Max('sign_time'))
#     print(result)
#     return 'hello'